package com.jdk.study.d2jvm.chapter02;

/**
 * @description:
 * @author: JackLi
 * @date: 2020/4/10 23:02
 */
public class ClassLoader05_ClinitTest {

    static class Father {
        public static int A = 1;

        static {
            A = 2;
        }
    }

    static class Son extends Father {
        public static int B = A;
    }

    public static void main(String[] args) {
        // 首先加载 Father 类， 其次加载 Son 类
        System.out.println(Son.B);  // 2
    }

}
